USE TMS
GO


--/*


IF OBJECT_ID ( 'tb_ToolRoom', 'U' ) IS NOT NULL 
    DROP table tb_ToolRoom;
GO
CREATE table tb_ToolRoom
(
ID int,
RoomName nvarchar(10)
)



IF OBJECT_ID ( 'tb_ToolRoom_GetAll', 'P' ) IS NOT NULL 
    DROP PROCEDURE tb_ToolRoom_GetAll;
GO
CREATE PROCEDURE tb_ToolRoom_GetAll
AS    
	select c.ID,c.ItemName,RoomName
	from tb_Config c left join tb_ToolRoom r on c.ID=r.ID
	where c.TypeID=1
	order by c.ID 
GO



IF OBJECT_ID ( 'tb_ToolRoom_Update', 'P' ) IS NOT NULL 
    DROP PROCEDURE tb_ToolRoom_Update;
GO
CREATE PROCEDURE tb_ToolRoom_Update
    @ID int,
    @RoomName nvarchar(10)
AS    
	update tb_ToolRoom set RoomName=@RoomName where ID=@ID 
GO



select * from tb_ToolRoom
select * from tb_Config where TypeID=1







































